<?php 

Class ModuleForgetPasswordFilters extends CmsModule {
    public function __init()
    {
		//$this->title = 'Forget Password Report';
		$this->id = 'forget_password';
		
		$modDateby = new CmsRadio();
		$modDateby->layout = 0;
		$modDateby->name = 'dateby';
		$modDateby->initTarget['custom_cssclass'] = 'member-dateby';  
		$modDateby->label = 'Show By';
		$modDateby->cols = 1;
		$modDateby->arr_options = AC::$member_showby_list_tmp1;
		$modDateby->bind = 'member_dateby';
		
        $days = array(31, 28, 31, 30, 31, 30, 31, 31, 30 , 31 ,30 ,31);
		if(date("Y")%4 == 0){
			$days[1] = 29;
		}
		$dayoptions = '';
		$mday = date("d");
		for($i=1;$i<=$days[date('n')];$i++){
            $i = ($i<10) ? '0'.$i : $i;
			$dayoptions .= "<option value='{$i}'".($i==$mday ? ' selected': '').">{$i} 日</option>";
		}
		$monthoptions = '';
		$mmonth = date("m");
		for($i=1;$i<13;$i++){
            $i = ($i<10) ? '0'.$i : $i;
			$monthoptions .= "<option value='{$i}'".($i==$mmonth ? ' selected': '').">{$i} 月</option>";
		}
		$arr_years = array();
		$yearoptions = '';
		$myear = date("Y");
		//for($i=2007;$i<date("Y")+1;$i++){
		for($i=2010;$i<date('Y')+10;$i++){
			$yearoptions .= "<option value='{$i}'".($i==$myear ? ' selected': '').">{$i} 年</option>";
			$arr_years[$i] = $i.' 年';
		}
				
		$modDate = new CmsCustomFormItem();
		$modDate->name = 'date';
		$modDate->initTarget['custom_cssclass'] = 'bydate member-date-item';  
		$modDate->label = 'Date';
		$modDate->custom_block = '<select name="month" class="month wauto">'.$monthoptions.'</select> <select name="day" class="day wauto">'.$dayoptions.'</select> <select name="year" class="year wauto">'.$yearoptions.'</select>';
		$modDate->bind = 'member_showbydate';
		
		$separator_hidden = new CmsSeparator();
		
		$fieldset1 = new CmsFieldset();
		$fieldset1->title = 'Show By';
		$fieldset1->addAll(array($modDateby,$modDate));
		
        $modbuttons = new CmsButton();
        $modbuttons->name = 'submit';
        $modbuttons->label = 'Submit';
        $modbuttons->type = 'button';
		
		$form = new CmsForm();
		$form->name = 'filter-form';
		$form->action='mstat_forget_result.html';
		$form->addAll(array(
			$fieldset1,$modbuttons
		));
		
		$this->setBlock('main', $form);
    }
	
}
?>